package com.lhn.spring5.service;

import com.lhn.spring5.dao.BookDao;
import com.lhn.spring5.dao.BookDaoImpl;
import com.lhn.spring5.entity.Order;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lhn
 * @date 2022/01/05 16:56
 * @since 1.0.0
 **/
@Service
public class BookService {

    @Autowired
    private BookDao bookDao;

    public void add(Order order) {
        bookDao.add(order);
    }

    public void updateOrder(Order order) {
        bookDao.updateOrder(order);
    }

    public void deleteOrder(int id) {
        bookDao.deleteOrder(id);
    }

    public int queryOrder(int id) {
       return bookDao.queryOrder(id);
    }

    public List <Order> findAll() {
        return bookDao.findAll();
    }

    public void batchAdd(List <Object[]> batchArgs) {
        bookDao.batchAdd(batchArgs);
    }

    public void batchUpdate(List <Object[]> batchArgs) {
        bookDao.batchUpdate(batchArgs);
    }

    public void batchDelete(List <Object[]> batchArgs) {
        bookDao.batchDelete(batchArgs);
    }
}